/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upf.userinterface.impl;

import edu.upf.content.DescriptionContent;
import edu.upf.core.User;
import edu.upf.network.ContentTransfer;
import edu.upf.utils.LogSystem;
import edu.upf.userinterface.UserInterface;

/**
 * Class that presents a text interface for the media sharing software
 * @author netjois
 */
public class TextInterface implements UserInterface {

    private LogSystem log;

    /**
     * Constructor, initializes the needed variables for a correct functioning
     * of the text user interface
     */
    public TextInterface(){
        log = new LogSystem(TextInterface.class);
    }

    @Override
    public void addUserToList(User user) {
        log.console("Adding user: "+user.getAddress());
    }

    @Override
    public void removeUserFromList(User user) {
        log.console("Removing user"+user);
    }

    @Override
    public void userLog(String ulog) {
        log.console("UserLog"+ulog);
    }

    @Override
    public void addResult(DescriptionContent receivedContent) {
        log.console("Received Content: "+receivedContent.getName());
    }

    @Override
    public void startChatWith(String user) {
        log.console("Openintg chat with user:"+user);
    }

    @Override
    public void updateState(int state) {
        log.console("New state: "+state);
    }

    @Override
    public void clearResults() {
        log.console("Clear results");
    }

    @Override
    public void viewContent(DescriptionContent content, boolean local) {
        log.console("View content");
    }

    @Override
    public void addTransfer(ContentTransfer transfer) {
        log.console("Add transfer");
    }

    @Override
    public void showExceptionMessage(String level,String message, String trace){
        log.console("Exception, level:"+level+"\nInfo:\n"+message);
    }

    @Override
    public void showContents() {
        log.console("Contents loaded");
    }

    @Override
    public void updateUserList(User user) {
        log.console("Updated user: " + user.getName());
    }

    @Override
    public void updateDownloads() {
        log.console("Updating downloads");
    }

    @Override
    public void showViewerImage(DescriptionContent content, boolean local) {
        log.console("Viewing image");
    }
}
